# -*- coding: utf-8 -*-
"""
@Author: Logan
@Date:   2025/6/29 14:49
@Description: 
"""


class HomeBase:
    def wallet_switch(self):
        """
        首页钱包开关
        :return:
        """
        return "//span[contains(@class,'switch')]"

    def login(self):
        """
        首页左上角logo
        :return:
        """
        return "//div[contains(text(),'校园二手交易系统')]"

    def welcome(self):
        """
        首页欢迎登录字样
        :return:
        """
        return "//span[starts-with(text(),'欢迎你回来')]"

    def show_data(self):
        """
        首页日历
        :return:
        """
        return "//div[contains(text(),'我的日历') and @class='calender']/following-sibling::div"

    def home_user_avatar(self):
        """
        首页登录用户头像
        :return:
        """
        # //span[text()='我的地址']/ancestor::div[@class='first_card']/div[contains(@class,'avatar')]
        return "//span[starts-with(text(),'欢迎您回来')]/parent::div/preceding-sibling::div"

    def user_balance(self):
        """
        首页-账户余额
        :return:
        """
        return "//th[text()='账户余额']/parent::tr/following-sibling::tr/td[1]"
